package cn.edu.scau.cmi.ema.domain;


import javax.persistence.*;
import javax.xml.bind.annotation.*;
import java.io.Serializable;

@Entity
@NamedQueries({ @NamedQuery(name = "findAllEvent9zxls", query = "select myEvent9zxl from Event9zxl myEvent9zxl"),
		@NamedQuery(name = "findEvent9zxlByNumber", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.number = ?1"),
		@NamedQuery(name = "findEvent9zxlByNumberContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.number like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByFood", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.food = ?1"),
		@NamedQuery(name = "findEvent9zxlByFoodContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.food like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByName", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.name = ?1"),
		@NamedQuery(name = "findEvent9zxlByNameContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.name like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByDiscoveryear", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoveryear = ?1"),
		@NamedQuery(name = "findEvent9zxlByDiscoveryearContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoveryear like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByDiscoverymonth", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoverymonth = ?1"),
		@NamedQuery(name = "findEvent9zxlByDiscoverymonthContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoverymonth like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByDiscoverydetailtime", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoverydetailtime = ?1"),
		@NamedQuery(name = "findEvent9zxlByDiscoverydetailtimeContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoverydetailtime like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByDiscoveryprovince", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoveryprovince = ?1"),
		@NamedQuery(name = "findEvent9zxlByDiscoveryprovinceContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoveryprovince like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByDiscoverydistrict", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoverydistrict = ?1"),
		@NamedQuery(name = "findEvent9zxlByDiscoverydistrictContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoverydistrict like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByDiscoverycounty", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoverycounty = ?1"),
		@NamedQuery(name = "findEvent9zxlByDiscoverycountyContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.discoverycounty like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlBySourceprovince", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.sourceprovince = ?1"),
		@NamedQuery(name = "findEvent9zxlBySourceprovinceContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.sourceprovince like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlBySourcedistrict", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.sourcedistrict = ?1"),
		@NamedQuery(name = "findEvent9zxlBySourcedistrictContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.sourcedistrict like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlBySourcecounty", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.sourcecounty = ?1"),
		@NamedQuery(name = "findEvent9zxlBySourcecountyContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.sourcecounty like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlBySource", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.source = ?1"),
		@NamedQuery(name = "findEvent9zxlBySourceContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.source like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlBySubject", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.subject = ?1"),
		@NamedQuery(name = "findEvent9zxlBySubjectContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.subject like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByProducer", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.producer = ?1"),
		@NamedQuery(name = "findEvent9zxlByProducerContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.producer like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByFoodsubtype", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.foodsubtype = ?1"),
		@NamedQuery(name = "findEvent9zxlByFoodsubtypeContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.foodsubtype like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByFoodmaintype", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.foodmaintype = ?1"),
		@NamedQuery(name = "findEvent9zxlByFoodmaintypeContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.foodmaintype like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByAdultertype", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.adultertype = ?1"),
		@NamedQuery(name = "findEvent9zxlByAdultertypeContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.adultertype like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByFoodbatchfiller", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.foodbatchfiller = ?1"),
		@NamedQuery(name = "findEvent9zxlByFoodbatchfillerContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.foodbatchfiller like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByAdulterlink", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.adulterlink = ?1"),
		@NamedQuery(name = "findEvent9zxlByAdulterlinkContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.adulterlink like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByDetectmethod", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.detectmethod = ?1"),
		@NamedQuery(name = "findEvent9zxlByDetectmethodContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.detectmethod like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByDescription", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.description = ?1"),
		@NamedQuery(name = "findEvent9zxlByDescriptionContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.description like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByEventpunish", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.eventpunish = ?1"),
		@NamedQuery(name = "findEvent9zxlByEventpunishContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.eventpunish like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByEventhazard", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.eventhazard = ?1"),
		@NamedQuery(name = "findEvent9zxlByEventhazardContaining", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.eventhazard like concat('%',?1,'%')"),
		@NamedQuery(name = "findEvent9zxlByImported", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.imported = ?1"),
		@NamedQuery(name = "findEvent9zxlByIslock", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.islock = ?1"),
		@NamedQuery(name = "findEvent9zxlById", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.id = ?1"),
		@NamedQuery(name = "findEvent9zxlByPrimaryKey", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.id = ?1 "),
		@NamedQuery(name = "deleteEvent9zxlsByIds", query = "delete Event9zxl where id in (?1)"),
		@NamedQuery(name = "findEvent9zxlsByIds", query = "select myEvent9zxl from Event9zxl myEvent9zxl where myEvent9zxl.id in (?1)"),
		@NamedQuery(name = "findEvent9zxlByPhyscialPrimaryKey", query = "select myEvent9zxl from Event9zxl myEvent9zxl where  myEvent9zxl.number = ?1"),
		@NamedQuery(name = "countEvent9zxlsByName", query = "select count(myEvent9zxl)  from Event9zxl myEvent9zxl where myEvent9zxl.name like concat('%',?1,'%')") })
@Table(catalog = "ema", name = "event9zxl")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "ema/cn/edu/scau/cmi/ema/domain", name = "Event9zxl")
@XmlRootElement(namespace = "ema/cn/edu/scau/cmi/ema/domain")

public class Event9zxl implements Serializable, Comparable<Event9zxl> {

	private static final long serialVersionUID = 1L;

	@Column(name = "id", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@XmlElement
	Integer id;

	@Column(name = "number")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String number;

	@Column(name = "food")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String food;

	@Column(name = "name")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String name;

	@Column(name = "discoveryear")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String discoveryear;

	@Column(name = "discoverymonth")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String discoverymonth;

	@Column(name = "discoverydetailtime")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String discoverydetailtime;

	@Column(name = "discoveryprovince")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String discoveryprovince;

	@Column(name = "discoverydistrict")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String discoverydistrict;

	@Column(name = "discoverycounty")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String discoverycounty;

	@Column(name = "sourceprovince")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String sourceprovince;

	@Column(name = "sourcedistrict")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String sourcedistrict;

	@Column(name = "sourcecounty")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String sourcecounty;

	@Column(name = "source")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String source;

	@Column(name = "subject")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String subject;

	@Column(name = "producer")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String producer;

	@Column(name = "foodsubtype")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String foodsubtype;

	@Column(name = "foodmaintype")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String foodmaintype;

	@Column(name = "adultertype")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String adultertype;

	@Column(name = "foodbatchfiller")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String foodbatchfiller;

	@Column(name = "adulterlink")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String adulterlink;

	@Column(name = "detectmethod")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String detectmethod;

	@Column(name = "description")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String description;

	@Column(name = "eventpunish")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String eventpunish;

	@Column(name = "eventhazard")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String eventhazard;

	@Column(name = "imported")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Boolean imported;

	@Column(name = "islock")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Boolean islock;

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return this.id;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getNumber() {
		return this.number;
	}

	public void setFood(String food) {
		this.food = food;
	}

	public String getFood() {
		return this.food;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return this.name;
	}

	public void setDiscoveryear(String discoveryear) {
		this.discoveryear = discoveryear;
	}

	public String getDiscoveryear() {
		return this.discoveryear;
	}

	public void setDiscoverymonth(String discoverymonth) {
		this.discoverymonth = discoverymonth;
	}

	public String getDiscoverymonth() {
		return this.discoverymonth;
	}

	public void setDiscoverydetailtime(String discoverydetailtime) {
		this.discoverydetailtime = discoverydetailtime;
	}

	public String getDiscoverydetailtime() {
		return this.discoverydetailtime;
	}

	public void setDiscoveryprovince(String discoveryprovince) {
		this.discoveryprovince = discoveryprovince;
	}

	public String getDiscoveryprovince() {
		return this.discoveryprovince;
	}

	public void setDiscoverydistrict(String discoverydistrict) {
		this.discoverydistrict = discoverydistrict;
	}

	public String getDiscoverydistrict() {
		return this.discoverydistrict;
	}

	public void setDiscoverycounty(String discoverycounty) {
		this.discoverycounty = discoverycounty;
	}

	public String getDiscoverycounty() {
		return this.discoverycounty;
	}

	public void setSourceprovince(String sourceprovince) {
		this.sourceprovince = sourceprovince;
	}

	public String getSourceprovince() {
		return this.sourceprovince;
	}

	public void setSourcedistrict(String sourcedistrict) {
		this.sourcedistrict = sourcedistrict;
	}

	public String getSourcedistrict() {
		return this.sourcedistrict;
	}

	public void setSourcecounty(String sourcecounty) {
		this.sourcecounty = sourcecounty;
	}

	public String getSourcecounty() {
		return this.sourcecounty;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getSource() {
		return this.source;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getSubject() {
		return this.subject;
	}

	public void setProducer(String producer) {
		this.producer = producer;
	}

	public String getProducer() {
		return this.producer;
	}

	public void setFoodsubtype(String foodsubtype) {
		this.foodsubtype = foodsubtype;
	}

	public String getFoodsubtype() {
		return this.foodsubtype;
	}

	public void setFoodmaintype(String foodmaintype) {
		this.foodmaintype = foodmaintype;
	}

	public String getFoodmaintype() {
		return this.foodmaintype;
	}

	public void setAdultertype(String adultertype) {
		this.adultertype = adultertype;
	}

	public String getAdultertype() {
		return this.adultertype;
	}

	public void setFoodbatchfiller(String foodbatchfiller) {
		this.foodbatchfiller = foodbatchfiller;
	}

	public String getFoodbatchfiller() {
		return this.foodbatchfiller;
	}

	public void setAdulterlink(String adulterlink) {
		this.adulterlink = adulterlink;
	}

	public String getAdulterlink() {
		return this.adulterlink;
	}

	public void setDetectmethod(String detectmethod) {
		this.detectmethod = detectmethod;
	}

	public String getDetectmethod() {
		return this.detectmethod;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return this.description;
	}

	public void setEventpunish(String eventpunish) {
		this.eventpunish = eventpunish;
	}

	public String getEventpunish() {
		return this.eventpunish;
	}

	public void setEventhazard(String eventhazard) {
		this.eventhazard = eventhazard;
	}

	public String getEventhazard() {
		return this.eventhazard;
	}

	public void setImported(Boolean imported) {
		this.imported = imported;
	}

	public Boolean getImported() {
		return this.imported;
	}

	public void setIslock(Boolean islock) {
		this.islock = islock;
	}

	public Boolean getIslock() {
		return this.islock;
	}

	public void copy(Event9zxl that) {

		setId(that.getId());

		setNumber(that.getNumber());
		setFood(that.getFood());
		setName(that.getName());
		setDiscoveryear(that.getDiscoveryear());
		setDiscoverymonth(that.getDiscoverymonth());
		setDiscoverydetailtime(that.getDiscoverydetailtime());
		setDiscoveryprovince(that.getDiscoveryprovince());
		setDiscoverydistrict(that.getDiscoverydistrict());
		setDiscoverycounty(that.getDiscoverycounty());
		setSourceprovince(that.getSourceprovince());
		setSourcedistrict(that.getSourcedistrict());
		setSourcecounty(that.getSourcecounty());
		setSource(that.getSource());
		setSubject(that.getSubject());
		setProducer(that.getProducer());
		setFoodsubtype(that.getFoodsubtype());
		setFoodmaintype(that.getFoodmaintype());
		setAdultertype(that.getAdultertype());
		setFoodbatchfiller(that.getFoodbatchfiller());
		setAdulterlink(that.getAdulterlink());
		setDetectmethod(that.getDetectmethod());
		setDescription(that.getDescription());
		setEventpunish(that.getEventpunish());
		setEventhazard(that.getEventhazard());
		setImported(that.getImported());
		setIslock(that.getIslock());

	}

	public Event9zxl() {

	}

	@Override
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("id=[").append(id).append("] ");

		buffer.append("number=[").append(number).append("] ");
		buffer.append("food=[").append(food).append("] ");
		buffer.append("name=[").append(name).append("] ");
		buffer.append("discoveryear=[").append(discoveryear).append("] ");
		buffer.append("discoverymonth=[").append(discoverymonth).append("] ");
		buffer.append("discoverydetailtime=[").append(discoverydetailtime).append("] ");
		buffer.append("discoveryprovince=[").append(discoveryprovince).append("] ");
		buffer.append("discoverydistrict=[").append(discoverydistrict).append("] ");
		buffer.append("discoverycounty=[").append(discoverycounty).append("] ");
		buffer.append("sourceprovince=[").append(sourceprovince).append("] ");
		buffer.append("sourcedistrict=[").append(sourcedistrict).append("] ");
		buffer.append("sourcecounty=[").append(sourcecounty).append("] ");
		buffer.append("source=[").append(source).append("] ");
		buffer.append("subject=[").append(subject).append("] ");
		buffer.append("producer=[").append(producer).append("] ");
		buffer.append("foodsubtype=[").append(foodsubtype).append("] ");
		buffer.append("foodmaintype=[").append(foodmaintype).append("] ");
		buffer.append("adultertype=[").append(adultertype).append("] ");
		buffer.append("foodbatchfiller=[").append(foodbatchfiller).append("] ");
		buffer.append("adulterlink=[").append(adulterlink).append("] ");
		buffer.append("detectmethod=[").append(detectmethod).append("] ");
		buffer.append("description=[").append(description).append("] ");
		buffer.append("eventpunish=[").append(eventpunish).append("] ");
		buffer.append("eventhazard=[").append(eventhazard).append("] ");
		buffer.append("imported=[").append(imported).append("] ");
		buffer.append("islock=[").append(islock).append("] ");

		return buffer.toString();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((id == null) ? 0 : id.hashCode()));
		return result;
	}

	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Event9zxl))
			return false;
		Event9zxl comparedEvent9zxl = (Event9zxl) obj;
		if (!CheckPropertyEqual(this.number, comparedEvent9zxl.number)) {
			return false;
		}
		return true;
	}

	public static <T> boolean CheckPropertyEqual(T originProperty, T comparedProperty) {
		// 基本类型经过参数传递后会自动装箱
		String[] className = originProperty.getClass().getName().split("\\.");
		if (className[0].equals("java") && className[1].equals("math")) {
			return ((Comparable) originProperty).compareTo(comparedProperty) == 0 ? true : false;
		} else {
			return originProperty.equals(comparedProperty);
		}
	}

	@Override
	public int compareTo(Event9zxl o) {
		if (this.getId() > o.getId()) {
			return 1;
		} else if (this.getId() == o.getId()) {
			return 0;
		} else {
			return -1;
		}

	}
}
